
def check(s):
    if len(s) != 19:
        return False
    print s
    a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
    idx = 0
    for i in xrange(0, 19, 2):
        if s[i] != str(a[idx]):
            return False
        idx += 1
    return True

def gao(n):
    nn = n* n
    if check(str(nn)):
        return True
    return False
start = 30000000
end = 10000000000
for i in xrange(start, end, 100):
    if gao(i + 30):
        print i + 30
        break
    if gao(i + 70):
        print i + 70
        break
print 'no'
